<template>
  <hcDialog
    dialogTitle="批次详情"
    :isVisable="productDetailShow"
    dialogWidth="50%"
    @closeDialog="closeDialog"
    @openDialog="openDialog"
  >
    <div class="pinfo">
      <hcDable :table-data="list" :options="tableopt" :columns="tableColumn"> </hcDable>
    </div>
  </hcDialog>
</template>
<script setup>
import { ref } from "vue";
let prop = defineProps({
  productDetailShow: {
    type: Boolean,
    default: false,
  },
  pdata: {
    type: Object,
    default: () => {},
  },
});

let emit = defineEmits(["closeDialog"]);

let tableopt = {
  showPagination: false,
  border: true,
};

let tableColumn = [
  { type: "index", width: "60", label: "NO.", align: "center", fixed: true },
  { prop: "pannun", label: "盘号", align: "center" },
  { prop: "recipeName", label: "配方名称", align: "center" },
  { prop: "pan", label: "盘属性", align: "center" },
];
//T3271X10102-07 240919163949 T3271X10102-07 BDA76DFNO
let list = ref([]);

function closeDialog() {
  emit("closeDialog");
}

function openDialog() {
  let pdata = prop.pdata;

  for (let i = 1; i < 20; i++) {
    list.value.push({
      pannun: Math.random().toString(16).slice(2, 10),
      recipeName: pdata.recipeName,
      pan: "整盘",
    });
  }
}
</script>
<style lang="scss" scoped>
.pinfo {
  width: 100%;
  height: 400px;
  display: flex;
  :depp(.el-table .el-table__row .cell) {
    color: #fff !important;
  }
  --title-color: #fff;
}
</style>
